<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>  
    <title>机构管理</title>   
<style type="text/css">
#main{
	  width:100%;
	  height:380px;	  
}
.-dtree {
	width:13%;
	height:380px;
	float:left;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #666;
}
#right{
	 width:85%;
	 height:380px;
	 float:left;
}
.STYLE1 {font-size: 12px}
.STYLE4 {
	font-size: 12px;
	color: #1F4A65;
	font-weight: bold;
}

a:link {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;

}
a:visited {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;
}
a:hover {
	font-size: 12px;
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.STYLE7 {font-size: 12}
</style>
     <link rel="stylesheet" type="text/css" href="../css/dtree.css"/>
      <script type="text/javascript" src="/AneelLeShan/js/jquery-1.4.2.min.js"></script>
      <script type="text/javascript" src="/AneelLeShan/js/jquery.blockUI.js"></script> 
      <script type="text/javascript" src="/AneelLeShan/js/dtree.js"></script>
    
    <script type="text/javascript">
	$(document).ready(function() {  
		  $.blockUI.defaults.css.cursor="none";
	  	  $('#add').click(function() {        
		    	$.blockUI({ message: $('#addSetup') });         
		  }); 
		  $('#closeAdd').click(function() {        
		    	$.unblockUI({ message: $('#addSetup') });         
		  });  
		  
		  $('#edit').click(function() {        
		    	$.blockUI({ message: $('#editSetup') });         
		  }); 
		  $('#closeEdit').click(function() {        
		    	$.unblockUI({ message: $('#editSetup') });         
		  }); 
		  
		  $('#update').click(function() {     
		  		if($('#name').val()==''){   
			    	  $('#message').html('输入员工姓名不能为空！');
			    	  
			    }else if($('#tel').val()==''){   
			    	  $('#message').html('电话号码不能为空！');
			    }else{
					$.ajax({
					   type: "POST",
					   url: "${path}/user/user!addaction",
					   data: "password="+$('#password').val()+"&newpassword="+$('#newpassword').val(),/*交给action处理*/
					   success: function(msg){
					 	  var jsonstr = eval('('+msg+')'); 
					      if(jsonstr.success){
					      	  alert(jsonstr.message);
					    	  $.unblockUI({ message: $('#addForm') });  
					      }else{
					      		$('#message').html(jsonstr.message);
					      }
					   }
					});			    	
			    }
		  });  
	 }); 
	</script>

  </head>
  
  <body>
    <h3 style="background-image:url('../images/top.gif'); border: 1px solid #00CCFF;">你现在的位置：基础信息管理--角色管理</h3>
    
    <div id="main">
         <div class="-dtree">
         	<script type="text/javascript">
	        	d = new dTree('d');
		        d.add(0,-1,'广元电业局');
		        d.add(1,0,'部门1','setup.jsp');
		        d.add(2,0,'部门2','setup.jsp');
				d.add(3,0,'部门3','setup.jsp');
				d.add(4,0,'部门4','setup.jsp');
				d.add(5,0,'部门5','setup.jsp');
				document.write(d);
			</script>
         </div>
        <div id="right">
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>
		<div style="width: 100%;">
    		<form action="#" method="post">
  			<table style="font-size: 12px;">
  				<tr>
  					<td><img src="../images/ico07.gif"/></td>
		  			<td style="font-size: 16px;">查询条件：根据</td>
		  			<td>
		  				<select style="width: 94px;">
		  					<option selected="selected">部门名称</option>
		  					<option>部门简称</option>
		  					<option>部门负责人</option>
		  					<option>部门经办人</option>
		  				</select>
		  			</td>
		  			<td style="font-size: 16px;">查询<input type="text"/></td>
		  			<td><div style="width: 75px;height: 20px;background-image: url('../images/button009.gif');cursor: pointer;" onclick="#"></div></td>
  				</tr>
  			</table>
  			</form>
    	</div>
		</td>
	</tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="30"><img src="../images/tab_03.gif" width="15" height="30" /></td>
        <td width="1101" background="../images/tab_05.gif"></td>
        <td width="281" background="../images/tab_05.gif"><table border="0" align="right" cellpadding="0" cellspacing="0">
            <tr>
              <td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center">
                        <input type="checkbox" name="checkbox62" value="checkbox" />
                    </div></td>
                    <td class="STYLE1"><div align="center">全选</div></td>
                  </tr>
              </table></td>
              <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><img src="../images/001.gif" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center"><a id="add">新增</a></div></td>
                  </tr>
                  
              </table></td>
              <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><img src="../images/114.gif" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center">导出</div></td>
                  </tr>
              </table></td>             
            </tr>
        </table></td>
        <td width="14"><img src="../images/tab_07.gif" width="14" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" background="../images/tab_12.gif">&nbsp;</td>
        <td bgcolor="#f3ffe3"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#c0de98" onmouseover="changeto()"  onmouseout="changeback()">
          <tr>
            <td width="6%" height="26" background="../images/tab_14.gif" class="STYLE1"><div align="center">选择</div></td>
            <td width="8%" height="26" background="../images/tab_14.gif" class="STYLE1"><div align="center">部门编号</div></td>
            <td width="10%" height="26" background="../images/tab_14.gif" class="STYLE1"><div align="center">部门名称</div></td>
            <td width="10%" height="18" background="../images/tab_14.gif" class="STYLE1"><div align="center">部门简称</div></td>
            <td width="25%" height="18" background="../images/tab_14.gif" class="STYLE1"><div align="center">负责人</div></td>
            <td width="20%" height="18" background="../images/tab_14.gif" class="STYLE1"><div align="center">经办人</div></td>
            <td width="9%" height="18" background="../images/tab_14.gif" class="STYLE1"><div align="center">编辑</div></td>
            <td width="9%" height="18" background="../images/tab_14.gif" class="STYLE1"><div align="center">删除</div></td>
          </tr>
         <% for(int i=0;i<10;i++){%> 
          <tr>
            <td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE1">
              <input name="checkbox" type="checkbox" class="STYLE2" value="checkbox" />
            </div></td>
            <td height="18" bgcolor="#FFFFFF" class="STYLE2"><div align="center" class="STYLE2 STYLE1">
             0001
            </div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">
            	部门名称
            </div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">
            	简称
            </div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">
            	<a href="#">负责人</a>
            </div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center" >
            	<a href="#">经办人</a>            
            </div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center">
            <img src="../images/037.gif" width="9" height="9" /><span class="STYLE1"> [</span><a id="edit" href="#">编辑</a><span class="STYLE1">]</span></div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center"><span class="STYLE2">
            <img src="../images/010.gif" width="9" height="9" /> </span><span class="STYLE1">[</span><a href="#" onclick="del()">删除</a><span class="STYLE1">]</span></div></td>
          </tr>
      <%} %>    
          
        </table></td>
        <td width="9" background="../images/tab_16.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="29"><img src="../images/tab_20.gif" width="15" height="29" /></td>
        <td background="../images/tab_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="25%" height="29" nowrap="nowrap"><span class="STYLE1">共120条纪录，当前第1/10页，每页10条纪录</span></td>
            <td width="75%" valign="top" class="STYLE1"><div align="right">
              <table width="352" height="20" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="62" height="22" valign="middle"><div align="right"><img src="../images/first.gif" width="37" height="15" /></div></td>
                  <td width="50" height="22" valign="middle"><div align="right"><img src="../images/back.gif" width="43" height="15" /></div></td>
                  <td width="54" height="22" valign="middle"><div align="right"><img src="../images/next.gif" width="43" height="15" /></div></td>
                  <td width="49" height="22" valign="middle"><div align="right"><img src="../images/last.gif" width="37" height="15" /></div></td>
                  <td width="59" height="22" valign="middle"><div align="right">转到第</div></td>
                  <td width="25" height="22" valign="middle"><span class="STYLE7">
                    <input name="textfield" type="text" class="STYLE1" style="height:10px; width:25px;" size="5" />
                  </span></td>
                  <td width="23" height="22" valign="middle">页</td>
                  <td width="30" height="22" valign="middle"><img src="../images/go.gif" width="37" height="15" /></td>
                </tr>
              </table>
            </div></td>
          </tr>
        </table></td>
        <td width="14"><img src="../images/tab_22.gif" width="14" height="29" /></td>
      </tr>
    </table></td>
  </tr>
</table>
        </div>
   </div>
 	<!-- 添加部门 -->
 	<div id="addSetup" align="center" style="position:relative;left:50%;display: none;width: 540px;height: 300px;">
	<div style="position:relative;left:-50%;z-index: 10;border: 3px solid #73A2d6;height: 100%;width: 100%;">
		<div id="head" style="background-color: #73A2d6; height:30px; color: #fff; font-weight: bold; font-size: 14px;">
  			<div style="float: left; padding:8px 10px 0px 10px;">部门添加</div>
  			<div style="float: right; padding:4px 10px 0px 10px;"><img id="closeAdd" src="../images/close.png" style="cursor: pointer;"></div>
  			</div>
  			<div align="center">
  			<form action="#" method="post">
  				<h3>添加部门信息</h3>
  				部门名称：<input type="text" name="name"/><br/>
  				部门简称：<input type="text" name="shortName"/><br/>
  				负责人：<input type="text" name="principal"/><br/>
  				经办人：<input type="text" name="transactor"/><br/>
  				<input type="submit" value="提交"/>&nbsp;&nbsp;&nbsp;<input type="reset" value="重置"/>
  			</form>
  			</div>
	</div>
	</div>
	<!-- 编辑部门 -->
	<div id="editSetup" align="center" style="position:relative;left:50%;display: none;width: 540px;height: 300px;">
	<div style="position:relative;left:-50%;z-index: 10;border: 3px solid #73A2d6;height: 100%;width: 100%;">
		<div id="head" style="background-color: #73A2d6; height:30px; color: #fff; font-weight: bold; font-size: 14px;">
  			<div style="float: left; padding:8px 10px 0px 10px;">部门编辑</div>
  			<div style="float: right; padding:4px 10px 0px 10px;"><img id="closeEdit" src="../images/close.png" style="cursor: pointer;"></div>
  		</div>
  		<div align="center">
  			<form action="#" method="post">
  				<h3>编辑部门信息</h3>
  				部门名称：<input type="text" name="name"/><br/>
  				部门简称：<input type="text" name="shortName"/><br/>
  				负责人：<input type="text" name="principal"/><br/>
  				经办人：<input type="text" name="transactor"/><br/>
  				<input type="submit" value="提交"/>&nbsp;&nbsp;&nbsp;<input type="reset" value="重置"/>
  			</form>
  		</div>
	</div>
	</div>
   
   <script type="text/javascript">
    function del(){
      confirm("确定要删除?");
    }
var  highlightcolor='#eafcd5';
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}


	var myTree = document.getElementById("managerTree");
	d = new dTree('d');
	var inner;

	function buildTree() {
		sysFunManager.finSysFunByRoleIdList(function(sysFunList) {
			d.add(0, -1, '管理菜单');
			for ( var i = 0; i < sysFunList.length; i++) {
				//alert(sysFunList[1]);
				//d.add(id, pid, name, url, title, target, icon, iconOpen, open);		
				d.add(sysFunList[i][0], 
					sysFunList[i][1], 
					sysFunList[i][2],
					sysFunList[i][3],
					null,
					'center');

			}
			inner = d.toString();
			showBuildTree();
		});
	}
	function showBuildTree() {
		myTree.innerHTML = inner;
	}
</script>
  </body>
</html>
